#ifndef ADC_H_
#define ADC_H_

#include <tT.h>
#include <env.h>

typedef struct adc_t
{
	tt_object_t super;
	
	uint32_t status;	// 1 = enable 0 = disable.
	uint32_t index;
	volatile int32_t raw[8];
	int32_t offset[8];
	int32_t value[8][8];
	
	
} adc_t;

#define adc() {tt_object(), 0}

extern adc_t adc;

env_result_t adc_init(adc_t *self, void *none);
env_result_t adc_calibrate(adc_t *self, uint32_t i);
env_result_t adc_send(uint32_t val);

#endif
